<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<script src="marked.min.js"></script>
<polymer-element name="marked-js" attributes="text">
  <template>
    <style>
      @host {
        * {
          position: relative;
          display: block;
          width: 300px;
          height: 300px;
          border: 1px solid gray;
          padding: 4px;
          font-family: Arial, sans-serif;
          font-size: 12px;
          background-color: whitesmoke;
        }
      }
    </style>
    <content></content>
  </template>
  <script>
    Polymer('marked-js', {
      text: '',
      textChanged: function () {
        this.text = this.text.replace(/\\n/g, '\n');
        this.innerHTML = marked(this.text);
      }
    });
  </script>
</polymer-element>

